package com.hyj.dev.res.proxy.entity;

import cn.hutool.core.util.ArrayUtil;
import com.hyj.dev.res.proxy.properties.ProxyRule;
import lombok.Data;

import java.util.Map;

/**
 * @author HeYuJie
 * @date 2023/2/20
 */
@Data
public class ParseContext {

    private String uri;
    private String subUri;
    private String queryParams;
    private String suffix;

    private ProxyRule rule;
    private Map<String, String[]> param;

    private String[] path;

    public String path(int i){
        String[] arr = ArrayUtil.sub(path, i, path.length);
        return ArrayUtil.join(arr, "/");
    }
    public String path(int start, int end){
        String[] arr = ArrayUtil.sub(path, start, end);
        return ArrayUtil.join(arr, "/");
    }

}
